#include <iostream>

using namespace std;

const int N = 15;

int T;
int n, st[N];
struct node{
	int t, d, l;
}a[N];

bool dfs(int pos, int end)
{
	if(pos > n) return true;
	
	for(int i = 1; i <= n; i++)
	{
		if(!st[i])
		{
			if(end > a[i].t + a[i].d) continue;
			st[i] = true;
			int begin = max(end, a[i].t);
			if(dfs(pos + 1, begin + a[i].l)) return true;
			st[i] = false;
		}
	}
	return false;
} 

int main()
{
	cin >> T;
	while(T--)
	{
		cin >> n;
		for(int i = 1; i <= n; i++) 
		{
			cin >> a[i].t >> a[i].d >> a[i].l;
			st[i] = 0;
		}
		if(dfs(1, 0)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}
